import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useToken = defineStore(
  'vue-hmzs-token',
  () => {
    const token = ref(null)
    const setToken = (value) => {
      token.value = value
    }
    const getToken = () => token.value
    const removeToken = () => (token.value = null)
    return { token, setToken, getToken, removeToken }
  },
  {
    persist: true // 可持久化的标记- 将我们的数据 持久化到前端缓存中
  }
)
export const usePassword = defineStore(
  'hmzs-password',
  () => {
    const Password = ref(null)
    const setPassword = (value) => {
      Password.value = value
    }
    const getPassword = () => Password.value
    const removePassword = () => (Password.value = null)
    return { Password, setPassword, getPassword, removePassword }
  },
  {
    persist: true // 可持久化的标记- 将我们的数据 持久化到前端缓存中
  }
)
